<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core_rt" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt_rt" %>

<html>
<head>
    <title>登录页</title>
    <%--echart线图、柱状图、饼图等各种图型库 cdn--%>
    <script type="text/javascript" src="https://cdn.jsdelivr.net/npm/echarts/dist/echarts.min.js"></script>
    <%--jquery cdn--%>
    <script type="text/javascript" src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.1/jquery.js"></script>
</head>
<body>
${error}
<form action="/login.do">
    手机号 <input name="phone"><br>
    验证码 <input name="phoneCode"> <input type="button" onclick="sendCode()" value="点击发送验证码"><br>
    <input type="submit" value="登录">
</form>
</body>
<script>
    function sendCode() {
        let phone = $('[name=phone]').val();

        $.ajax({
            url:'/sendCode.do?phone=' + phone,
            success:function (data) {
                console.log(data)
            }
        })
    }

</script>
</html>